/*******************************************************************************
 * Copyright (c) 2012 Oracle. All rights reserved.
 * This program and the accompanying materials are made available under the 
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
 * which accompanies this distribution. 
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at 
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *      Oracle - initial impl
 ******************************************************************************/
package de.lang.rollo.controller.model;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.servlet.annotation.ServletSecurity;

import org.mongojack.ObjectId;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import de.lang.rollo.controller.enums.EventType;
import de.lang.rollo.controller.enums.JobType;

public class RolloEvent implements Serializable {
	/* The id uses the generated OID (UUID) from Mongo. */
	@JsonIgnore
	public static final String JOB_SUFFIX = "_job";
	@JsonIgnore
	public static final String TRIGGER_SUFFIX = "_trigger";
	@JsonIgnore
	public static final String KEY_EVENT_TYPE = "ev_type";
	@JsonIgnore
	public static final String KEY_MOTOR = "motor";

	private String id;

	private JobType rolloType;
	private EventType eventType;

	private RolloMotor motor;

	private char[] trigger;

	public RolloEvent() {
	}

	  @ObjectId
	  @JsonProperty("_id")
	public String getId() {
		return id;
	}
	
	  @ObjectId
	  @JsonProperty("_id")
	public void setId(String id) {
		this.id = id;
	}

	public JobType getRolloType() {
		return rolloType;
	}

	public void setRolloType(JobType rolloType) {
		this.rolloType = rolloType;
	}

	public EventType getEventType() {
		return eventType;
	}

	public void setEventType(EventType eventType) {
		this.eventType = eventType;
	}

	public RolloMotor getMotor() {
		return motor;
	}

	public void setMotor(RolloMotor motor) {
		this.motor = motor;
	}

	public char[] getTrigger() {
		return trigger;
	}

	public void setTrigger(char[] trigger) {
		this.trigger = trigger;
	}

}
